package net.huashitong.synthetical.gradePoint.service;

import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.sys.base.StringPKService;
import com.sirdc.modules.sys.service.SysTableService;
import net.huashitong.synthetical.gradePoint.dao.GradePointDao;
import net.huashitong.synthetical.gradePoint.entity.GradePoint;
import net.huashitong.synthetical.gradePoint.filter.GradePointFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GradePointService extends StringPKService<GradePoint> {
    @Override
    protected BaseDao<GradePoint, String> getDao() {
        return dao;
    }

    @Override
    protected void beforeSave(GradePoint obj) {
        obj.setSysId(sysTableService.updateMaxSysId("t_GradePoint",null));
    }

    @Autowired
    private SysTableService sysTableService;

    @Autowired
    private GradePointDao dao;


    public List<GradePoint> queryByFilter(GradePointFilter filter){
        return dao.queryByFilter(filter);
    }
}
